<template>
	<view class="page">
		<div class="weui-search-bar" style="position: relative; ">
			 <i class="weui-icon-search"></i>
		<input type="search" class="search-input pbt5" id='search' placeholder='请输入活动名称关键字....'/>
		<button class="weui-btn weui-btn_mini" ><span class="iconfont icon-wodedangxuan-copy f-green"></span></button>
		</div>
		<!-- 搜索end -->
		<div class="weui-panel__bd sc-xyfc">
			<navigator :url="'/pages/activity/index?id='+activity.id" v-for="(activity,index) in activitys" :key="activity.id" class="weui-media-box weui-media-box_appmsg">	
				<div class="weui-media-box__hd">
					<img class="weui-media-box__thumb" :src="activity.posterPath" alt="">
				</div>
				<div class="weui-media-box__bd">
					<h4 class="weui-media-box__title">{{activity.activityName}}</h4>
					<p class="weui-media-box__desc">{{activity.activityTimeStart}} 到 {{activity.activityTimeEnd}}</p>
					<p class="weui-media-box__desc">{{activity.orgName}}</p>
					<p class="tright"><span class="weui-btn weui-btn_mini  b-green">{{activity.signNumAlready}}人已报名</span></p>
				</div>
			</navigator>
		
		</div>
		<!-- <tab-bar :current="1"></tab-bar> -->
	</view>

</template>

<script>
	// import tabBar from '../../components/tabBar.vue';
	export default {
		data() {
			return {
				activitys: []
			}
		},
		components: {
			// tabBar
		},
		onLoad() {
			this.getList();
		},
		methods: {
			getList(){
				let _self = this;
				this.$get(this.$api.activityList, {}).then(res => {
					if (res.code == 0) {
						_self.activitys = res.activitys;
					} else {
						uni.showModal({
							title: '操作提示',
							content: res.msg,
							showCancel: false
						})
					}
				})
			}
		}
	}
</script>

<style>
	.sc-xyfc .weui-btn_mini{font-size: 22upx; text-align: center;}
</style>
